package com.example.mydemo1.controller;

import com.example.mydemo1.entity.common.AppResp;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 * 用于测试而已哦
 * </p>
 *
 * @createTime: 2023/09/16 14:29:44
 */
@Api(tags = "测试控制器类")
@Validated
@RestController("testController4mydemo1")
@RequestMapping("/api/v1/test/test")
public class TestController {

    @ApiOperation(value = "测试异常 ")
    @GetMapping("/error")
    public AppResp<String> page(@RequestParam(name = "x") int x) {
        System.out.println("x:" + x);
        int y = 1 / x;

        return AppResp.success(y + "");
    }


}